package com.ihr360.commons.model.type;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.ihr360.commons.model.annotation.EnumData;
import com.ihr360.commons.serializer.jackson.EnumDataSerializer;

/**
 * 操作枚举
 */
@EnumData
@JsonSerialize(using = EnumDataSerializer.class)
public enum NumOperation {
    ADD {
        public String getTitle() {
            return "加项";
        }
    },
    SUBTRACT {
        public String getTitle() {
            return "减项";
        }
    }; 
   /* MULTIPY{
        public String getTitle(){
			return "乘项";
		}
    }, 
    DIVIDE{
		public String getTitle(){
			return "除项";
		}
    };*/


    @JsonCreator
    public static NumOperation factory(@JsonProperty(value = "id") String id) {
        return NumOperation.valueOf(id);
    }

    public String getTitle() {
        throw new UnsupportedOperationException();
    }

    public static NumOperation[] getAddSub() {
        return new NumOperation[]{ADD, SUBTRACT};
    }
}